package advanced.java.ch01.p1.application;

import java.io.IOException;
import java.net.UnknownHostException;

import advanced.java.ch01.p1.ClientStubFactory;

public class Client {

	public static void main(String[] args) throws Exception {
		
		ClientStubFactory factory=new ClientStubFactory("advanced.java.ch01.p1.application.Service", "127.0.0.1", 8009);
		Service service = (Service) factory.getStub();
		String r=service.hello("zhoushuang");
		service.hello("zhoushuang");
		service.hello("zhoushuang");
		System.out.println(r);
		
		Service service2 = (Service) factory.getStub();
		r=service2.hello("server2");
		service2.hello("zhoushuang double");
		service2.hello("zhoushuang double");
		
		
		System.out.println(r);
	}

}
